<?php
/**
 * Created by PhpStorm.
 * User: XD
 * Date: 2017/8/31
 * Time: 16:40
 */
function autoLoadClass($className)
{
    //echo "调用一次";
    $dir = array("base","builder","log","model");
    $bool = true;
    $i = 0;
    do{
        $file = dirname(__FILE__)."/".$dir[$i]."/".$className.".php";
        //echo "当前状态值：bool : $bool , i:$i ， file: $file";
        $i++;
        if(file_exists($file)){
            //echo "判断进入，应该跳出循环了";
            include ($file);
            $bool = false;
        }
    }while($bool);
}

spl_autoload_register('autoLoadClass');
\app\log\Testlog::go();  // 初始化日志函数
?>

